package com.igrid.demo.client;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.PopupPanel;

public class ColumnMoveIndicator{

	private PopupPanel top;
	
	private PopupPanel bottom;

	public ColumnMoveIndicator() {
		top = new PopupPanel();
		bottom = new PopupPanel();
		Image img1 = new Image("col-move-top.gif");
		Image img2 = new Image("col-move-bottom.gif");
		top.add(img1);
		bottom.add(img2);
	}
	
	/**
	 * Set the column move indicator to the left edge for the given cell
	 * 
	 * @param cell
	 */
	public void setPosition(int absoluteLeft,int absoluteTop,int spaceInterval){
		top.show();
		top.setPopupPosition(absoluteLeft-7,absoluteTop-9);
		bottom.show();
		bottom.setPopupPosition(absoluteLeft-7,absoluteTop+spaceInterval);
	}
	
	public void hide(){
		top.hide();
		bottom.hide();
	}
	
	
}
